package by.msokoloff.javaweb2015.services;

import java.util.List;

import javax.persistence.metamodel.SingularAttribute;

import org.springframework.transaction.annotation.Transactional;

import by.msokoloff.javaweb2015.datamodel.AdmUser;
import by.msokoloff.javaweb2015.datamodel.enums.AdmUserStatus;

public interface AdmUserService {

	AdmUser get(Integer id);

	List<AdmUser> getAll();
	
	List<AdmUser> getAll(SingularAttribute<AdmUser, ?> attr, boolean ascending, int startRecord, int pageSize);
	
	Long getCount();

	List<AdmUser> getByStatus(AdmUserStatus status);
	
	List<AdmUser> getByField(SingularAttribute<AdmUser, ?> attr, Object val);

	@Transactional
	void createOrUpdate(AdmUser admUser);

	@Transactional
	void delete(AdmUser admUser);
	
	@Transactional
	void delete(List<Integer> ids);

	@Transactional
	void deleteAll();

}
